﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title>美豆日记</title>
    <link href="/style/rightdirectory.css" rel="stylesheet" />
    <script src="/script/list-config.js"></script>
</head>
<style>
    th {
        text-align: center;
    }
    td {
        text-align: center;
    }
   
</style>
<body>
    <div class="view-page">
        <!--搜索区域-->
        <div class="view-search inline">
            <div class="form-inline">
                <div class="form-group col-sm-2">
                    <div class="input-group">
                        <span class="input-group-addon">变化后金额</span>
                        <input id="query" type="text" class="form-control" data-form="ChangeLastMoeny" placeholder="变化后金额">
                    </div>
                </div>
                <div class="form-group col-sm-2">
                    <div class="input-group">
                        <span class="input-group-addon">用户id</span>
                        <input id="query" type="text" class="form-control" data-form="Customer_Id" placeholder="用户id">
                    </div>
                </div>
                <div class="form-group col-sm-1">
                    <button type="button" id="btn-search" class="btn btn-primary">
                        <i class="fa fa-search"></i> 搜索
                    </button>
                </div>
            </div>
        </div>
   
        <div class="view-data">
            <table id="table" class="table table-bordered table-hover" data-post="">
                <thead>
                    <tr>
                        <th>用户id</th>
                        <th>订单号</th>
                        <th>用户充值前美豆</th>
                        <th>用户充值金额</th>
                        <th>用户充值后美豆</th>
                        <th>充值渠道</th>
                        <th>备注</th>
                        <th>充值时间</th>
                    </tr>
                </thead>
                <tbody></tbody>
            </table>
            <!--分页条 默认选择id=list-page元素-->
            <div id="list-page" class="view-pagination-page"></div>
        </div>
    </div>

   
</body>

</html>
<script type="text/html" id="tp-table">
    {{each list d}}
    <tr>
        <td>{{d.Customer_Id}}</td>
        <td>{{d.OrderNo}}</td>
        <td>{{d.BeforeAmount}}</td>
        <td>{{d.Amount}}</td>
        <td>{{d.AfterAmount}}</td>
        <td>{{if d.Type==1 }} 后台 {{else if d.Type==2}} 移动端 {{/if}}</td>
        <td>{{d.Memo}}</td>
        <td>{{d.CreateDate|to_date}}</td>
    </tr>
    {{/each}}
</script>

<script type="text/javascript">
    $(function() {
        function _LoadData() {
            var parm = $(".view-search").getFormData();
            $("#table").ajaxPageTable("rechargelog/list", parm, function (d) {
                console.log(d)
                $("#table>tbody").append(template("tp-table", {
                    list: d
                }));
            })
        }
        _LoadData();//初启化
        $(".form-control").focus(function () { //搜索按钮
            $(".form-control").keydown(function(e) {
                if (e.keyCode == 13) {
                    _LoadData();
                }
            })
        })
        $("#btn-search").click(function() { //搜索按钮
            _LoadData();
        })      
    })
</script>